package com.hjtech.base.retroft.provide;

import android.content.Context;

import com.alibaba.android.arouter.facade.annotation.Autowired;
import com.alibaba.android.arouter.launcher.ARouter;

/*
 * 项目名:    HjtechARouterFrame
 * 包名       com.hjtech.base.retroft
 * 文件名:    NetManagerImpl
 * 创建者:    ZJB
 * 创建时间:  2017/10/26 on 10:20
 * 描述:     TODO
 */

public abstract class NetManagerImpl<T> implements NetManager {

    @Autowired
    InterceptorProvide interceptorProvide;

    @Autowired
    OkHttpClientProvide okHttpClientProvide;

    @Autowired
    RetrofitProvide retrofitProvide;

    protected T apiService;


//    public Interceptor getInterceptor() {
//        return interceptorProvide.getHttpLoggingInterceptor();
//    }
//
//
//    public OkHttpClient getOkHttpClient(Interceptor interceptor) {
//        return okHttpClientProvide.getOkHttpClient(interceptor);
//    }
//
//
//    public Retrofit getRetrofit(OkHttpClient okHttpClient) {
//        return retrofitProvide.getRetrofit(Constant.BASE_URL, okHttpClient);
//    }


    @Override
    public T getApiService() {
//        Retrofit retrofit = getRetrofit(getOkHttpClient(getInterceptor()));
//        return (T) retrofit.create(apiService.getClass());
        return null;
    }

    @Override
    public void init(Context context) {
        ARouter.getInstance().inject(this);
    }
}
